using System.ComponentModel.DataAnnotations;

namespace OutpatientApi.DTO
{
    /// <summary>
    /// 添加病房DTO
    /// </summary>
    public class AddRoomDto
    {
        /// <summary>
        /// 病房编号,如301、302(支持前缀+数字)
        /// </summary>
        [Required(ErrorMessage = "病房编号不能为空")]
        [StringLength(20, ErrorMessage = "病房编号长度不能超过20个字符")]
        public string RoomNumber { get; set; } = string.Empty;

        /// <summary>
        /// 所在楼层,如3、4
        /// </summary>
        [Required(ErrorMessage = "楼层不能为空")]
        [Range(1, 100, ErrorMessage = "楼层必须在1-100之间")]
        public int Floor { get; set; }

        /// <summary>
        /// 关联科室表的外键
        /// </summary>
        [Required(ErrorMessage = "科室ID不能为空")]
        public int DepartmentId { get; set; }

        /// <summary>
        /// 病房类型ID，关联病房类型表
        /// </summary>
        [Required(ErrorMessage = "病房类型ID不能为空")]
        public int RoomTypeId { get; set; }

        /// <summary>
        /// 该病房可容纳的病床总数
        /// </summary>
        [Required(ErrorMessage = "病床数量不能为空")]
        [Range(1, 20, ErrorMessage = "病床数量必须在1-20之间")]
        public int Number_beds { get; set; }

        /// <summary>
        /// 每日住院费用(单位:元)
        /// </summary>
        [Required(ErrorMessage = "每日住院费用不能为空")]
        [Range(0.01, 999999.99, ErrorMessage = "每日住院费用必须在0.01-999999.99之间")]
        public decimal Price { get; set; }
    }

    /// <summary>
    /// 批量添加病房DTO
    /// </summary>
    public class BatchAddRoomDto
    {
        /// <summary>
        /// 病房列表
        /// </summary>
        [Required(ErrorMessage = "病房列表不能为空")]
        [MinLength(1, ErrorMessage = "至少需要添加一个病房")]
        [MaxLength(100, ErrorMessage = "单次最多只能添加100个病房")]
        public List<AddRoomDto> Rooms { get; set; } = new List<AddRoomDto>();
    }


    /// <summary>
    /// 房间号
    /// </summary>
    public class RoomDataDto
    {
        public int RoomId { get; set; }

        /// <summary>
        /// 病房编号,如301、302(支持前缀+数字)
        /// </summary>

        public string RoomNumber { get; set; }
    }
} 